<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
    <link href="mian_body.css" rel="stylesheet" type="text/css">
    <style type="text/css">
        body{
            background-image: url(../imagse/R08d7ed7e6071e337daec02d0cbe3964b.jpg);
            background-size: 100% 100%;
            width: 100%;
            height: 1024px;
        }
    </style>
</head>

<body>
<h2 style="text-align: center;margin-top: 3%;">#查询结果#</h2>
    <?php $id=$_POST['user_id'];?>
    <div style="float: right;margin-right: 15%;">
        <a href="main.php<?php echo "?id=$id";?>">返回首页</a>
    </div>
<ul id="masonry" class="slider" style="width: 75%;margin-left: 10%;margin-top: 7%;">
    <?php
         $conn=@mysql_connect("localhost","root","")  or die(mysql_error());
         mysql_query("SET NAMES UTF8");
         @mysql_select_db('guyueyan',$conn) or die(mysql_error());
         
         
         print_r($_POST);
        $str=$_POST['str'];   //搜索的内容
        $chaxun = "SELECT id,name FROM user WHERE name LIKE '%$str%'";
        $cha_id = mysql_query($chaxun);  //得到的用户集
    
        while($user = mysql_fetch_row($cha_id)){
        
        $user_id = $user[0];
        /*$cha_name = "SELECT name FROM user WHERE id =$user_id";*/
        $uesr_name = $user[1];
         
        echo " <li class='block'>
            <div style='background-color: antiquewhite'>"; 
            //头像部分
        echo "<div class='blogger' style='background-color:#bfefff'>
                    <div class='pos-img'>
                     <img src='../imagse/61de.jpg' width='75px' height='75px' alt=''/> 
                    </div>
                    <a href=# style='text-align: center;font-size: 18px;color: rgba(0,0,0,.64);padding: 0px;'><h3>「{$uesr_name}」</h3></a>
                </div>"; 
            //图片展示外  标记02
        echo "<div class='blogger1'>
                    <h2 class='illust-title'>作品展示</h2>
               <ul class='illust-content'>";
                   //图片展示内
            
        $cha_photo = "SELECT id,name,url FROM pictures WHERE user_id=$user_id order by rand()";
        $zhanshi = mysql_query($cha_photo);
        $j=0;           
        
        while($j<4 && $as = mysql_fetch_row($zhanshi)){
            $photo_id = $as[0];
            $name = $as[1];
            $url = $as[2];
            //标记03                                单指图片id
            echo " <a href='mian_pgoto_xianshi.php?id=$photo_id' target='_blank' style='padding: 0px;'>
                    <li class='pix-card'>
                    <div class='illust'>
                        <div class='el-image'>"; 
            echo " <img src='$url?x-oss-process=image/resize,m_fill,w_450'  alt='' width='32' height='32' class='el-image__inner'/> ";

            //标记03
            echo "</div> </div>  </li> </a>";
            $j++;
            
        }
        
                   
        //标记02   
        echo "</ul> </div>";        
                   
        echo " </div> </li>"; 
    }
      
        
    ?>

    </ul>
</body>
</html>